
#include <string.h>
#include <math.h>
#include "system.h"
#include "f1c100s_de.h"
#include "f1c100s_timer.h"
#include "f1c100s_intc.h"
#include "f1c100s_gpio.h"
#include "f1c100s_pwm.h"
#include "f1c100s_uart.h"
#include "arm32.h"
#include "time0.h"
#include "ws2812.h"

int main(void)
{
  system_init();            // Initialize clocks, mmu, cache, uart, ...
  arm32_interrupt_enable(); // Enable interrupts
  timer0_init();
  printf("\r\napp [WS2812 RGB demo] run. compiled_time %s %s\r\n", __DATE__, __TIME__);
  ws2812_gpio_init();
  delay(200);
  int grb[] = {0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff, 0x00ffff, 0x338a6b, 0x3875ab};

  while (1)
  {

    ws2812_write(grb, 8);
    ws2812_reset();
    swap_grb(grb, 8);
    delay(100);
  }
}
